/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.sgsmcan.Dao;

import com.sgsmcan.Entidad.EventoFrecuente;
import com.sgsmcan.Hibernate.HibernateUtil;
import java.util.List;
import org.hibernate.Query;
import org.hibernate.Session;

/**
 *
 * @author David
 */
public class EventoFrecuenteImpl extends HibernateDao<EventoFrecuente>  implements EventoFrecuenteDao<EventoFrecuente>{

    @Override
    public List<EventoFrecuente> getEventos() {
        List<EventoFrecuente> list = null;
        Session session = null;
        try {
            session = HibernateUtil.getSessionFactory().openSession();
            Query query = session.createQuery("FROM EventoFrecuente");
            list = query.list();
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (session != null) {
                session.close();
            }
        }
        return list;
    }

    
    
}
